﻿using Web.Model;

namespace Web.DataAccess.Mappings
{
    public class NewsMapping : EntityMapping<News>
    {
        public NewsMapping()
		{
			Map(x => x.Title);
			Map(x => x.Content);
            Map(x => x.ShortContent);
			Map(x => x.DateCreated);
            Map(x => x.IsHidden);
			References(x => x.Author);
		    HasMany(x => x.Photos).Cascade.SaveUpdate();
			References(x => x.NewsAvatar).Cascade.SaveUpdate();
		}
    }
}